import request from '@/utils/request'
import Qs from 'qs'

/**
 * 查询操作
 */
export function queryOperation() {
  return request({
    url: '/sys/operationLogger/queryOperation',
    method: 'get'
  })
}

/**
 * 查询操作日志
 */
export function list(data) {
  return request({
    url: '/sys/operationLogger/list',
    method: 'get',
    params: data
  })
}

/**
 * 删除操作日志
 * @param {array} data 角色id
 */
export function deleteByIds(data) {
  return request({
    url: '/sys/operationLogger/deleteByIds',
    method: 'delete',
    params: {
      logIds: data
    },
    paramsSerializer: params => {
      return Qs.stringify(params, { indices: false })
    }
  })
}

/**
 * 清空操作日志
 */
export function clear() {
  return request({
    url: '/sys/operationLogger/clear',
    method: 'delete'
  })
}
